import { Callout } from '@theguild/components'

# Migration

Here we explain a new syntax and how to migrate from `v2.0` to `v3.0`.

<Callout type="warning">
  **LIBRARY AUTHORS.** Legacy syntax (v2.0) is deprecated but still supported through the API of GraphQL Config v3.0. As
  a library author, you consume GraphQL Config API as usual, the legacy syntax is backported to a new one under the
  hood.
</Callout>

## Migration Tool

We prepared a command-line tool to help you migrate your legacy GraphQL Config:

```sh
npx graphql-config-migrate
```

The migration tool will ask a few questions and move your config files to the new syntax.

## New Syntax

### `schemaPath`

Read ["Usage"](/docs/user/usage#schema) chapter to understand the `schema` field.

```diff
- schemaPath: "schema.graphql"
+ schema: "schema.graphql"
```

### `includes` and `excludes`

Minor change here, remove the `s` at the end. The logic behind `include` and `exclude` stays the same but please read about it in ["Usage"](/docs/user/usage#include--exclude) chapter.

```diff
- includes: "src/*.graphql"
+ include: "src/*.graphql"
```

```diff
- excludes: "tests/*.graphql"
+ exclude: "tests/*.graphql"
```

### `documents` (new)

Read ["Usage"](/docs/user/usage#documents) chapter to understand new `documents` field.

```diff
+ documents: "ui/*.graphql"
```

### `extensions`

No changes here, but please read the ["Usage"](/docs/user/usage#extensions) chapter.

### `projects`

No changes here, but please read the ["Usage"](/docs/user/usage#projects) chapter.
